package hrm.serviceimple;

import hrm.dao.ScheduleDAO;
import hrm.daoimple.ScheduleDAOImple;
import hrm.dto.schedule.ScheduleDTO;

import java.util.List;

public class ScheduleServiceImple implements ScheduleDAO {
	private ScheduleDAO scheduleDAO;
	private static ScheduleServiceImple scheduleService;
	
	private ScheduleServiceImple(){
		setScheduleDAO(new ScheduleDAOImple());
	}
	
	public static ScheduleServiceImple getInstance(){
		if (scheduleService==null) {
			scheduleService=new ScheduleServiceImple();
		}
		return scheduleService;
	}

	public void setScheduleDAO(ScheduleDAO scheduleDAO) {
		this.scheduleDAO = scheduleDAO;
	}

	public ScheduleDAO getScheduleDAO() {
		return scheduleDAO;
	}
	
	@Override
	public int addMyschedule(ScheduleDTO dto) {
		// TODO Auto-generated method stub
		return scheduleDAO.addMyschedule(dto);
	}

	@Override
	public int deleteSchedule(ScheduleDTO scdto) {
		// TODO Auto-generated method stub
		return scheduleDAO.deleteSchedule(scdto);
	}

	@Override
	public List<ScheduleDTO> getAllSchedule() {
		// TODO Auto-generated method stub
		return scheduleDAO.getAllSchedule();
	}

	@Override
	public ScheduleDTO getMySchedule(ScheduleDTO dto) {
		// TODO Auto-generated method stub
		return scheduleDAO.getMySchedule(dto);
	}

	@Override
	public List<ScheduleDTO> getMyScheduleSubstr(String id) {
		// TODO Auto-generated method stub
		return scheduleDAO.getMyScheduleSubstr(id);
	}

	@Override
	public int updateSchedule(ScheduleDTO scdto) {
		// TODO Auto-generated method stub
		return scheduleDAO.updateSchedule(scdto);
	}
}
